var express = require("express");
var bodyParser = require('body-parser');

var router = express.Router();
var urlencodedParser = bodyParser.urlencoded({ extended: false });

// Expect req.body:
// {
//     "acc": "Monkeyhbd",
//     "pas": "123345567"
// }
router.post("/login", urlencodedParser, function(req, res) {
	res.send(req.body);
});

// Expect req.body:
// {
//     "acc": "Monkeyhbd",
//     "pas": "123345567"
// }
router.post("/register", urlencodedParser, function(req, res) {
	res.send(req.body);
});

// Expect req.body
// {
//     "acc": "Monkeyhbd",
//     "pas": "123345567",
//     "mes": "Hello Monkeyhbd."
// }
router.post("/send-message", urlencodedParser, function(req, res) {
	res.send(req.body);
});

// Expect req.body (Empty)
// {}
router.post("/get-message", urlencodedParser, function(req, res) {
	res.send(req.body);
});

module.exports = router;
